package com.example.piece.ui.adapter

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentStatePagerAdapter
import com.example.piece.BR

class ViewPagerAdapter(fm: FragmentManager, private val fragments:List<Fragment>,private val titles:List<String> ) : FragmentStatePagerAdapter(fm) {
    override fun getCount(): Int =fragments.size

    override fun getItem(position: Int): Fragment {
        return fragments[position]
    }

    override fun getPageTitle(position: Int): CharSequence? {
        return titles[position]
    }

}